﻿
<link href="@Url.Content("~/Content/UpLoad.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Content/swfupload/swfupload.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Content/swfupload/handlers.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
<script type="text/javascript">
    var swfu;
    window.onload = function () {
        swfu = new SWFUpload({

            // Backend Settings
            upload_url: '@Url.Action("UpLoad")',
            post_params: {
                "ASPSESSID": "@Session.SessionID",
                "userId": '@ViewBag.UserKey'
            },

            // File Upload Settings
            file_size_limit: "4 MB",
            file_types: "*.jpg;*.jpeg;*.png;*.gif",
            file_types_description: "Images",
            file_upload_limit: "0",    // Zero means unlimited

            // Event Handler Settings - these functions as defined in Handlers.js
            //  The handlers are not part of SWFUpload but are part of my website and control how
            //  my website reacts to the SWFUpload events.
            file_queue_error_handler: fileQueueError,
            file_dialog_complete_handler: fileDialogComplete,
            upload_progress_handler: uploadProgress,
            upload_error_handler: uploadError,
            upload_success_handler: uploadSuccess,
            upload_complete_handler: uploadComplete,

            // Button settings
            button_image_url: '@Url.Content("~/Content/images/btn_addpic.jpg")',
            button_placeholder_id: "spanButtonPlaceholder",
            button_width: 101,
            button_height: 32,
            button_text: '<span class="button"></span>',
            button_text_style: '.button { font-size: 12px;cursor: pointer; }',
            button_text_top_padding: 1,
            button_text_left_padding: 5,

            // Flash Settings
            flash_url: '@Url.Content("~/Content/swfupload/swfupload.swf")',

            custom_settings: {
                upload_target: "divFileProgressContainer"
            },

            // Debug Settings
            debug: false
        });
    }

    function Showdelete(picId) {
      
        document.getElementById(picId).style.display = "none";
        document.getElementById(picId).innerHTML="";
        $.post('@Url.Action("DeletePic")',  
           {
               id: picId,
               infoid:"@(Model != "" ? Model.ToString() : "")"
           }  
        );
       }
       window.onunload = function () {
           $.post('@Url.Action("ClearePicDictionary")');
       }
</script>
<div id="thumbnails">
</div>
<div id="divFileProgressContainer">
</div>
<div id="btn_selectPic">
    <span id="spanButtonPlaceholder"></span>
</div>
